package com.vcc.service.boss.response.permission;

import com.vcc.data.entity.Permission;
import com.vcc.service.boss.response.baseVo.BossBaseVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Getter
@Setter
public class PermissionVoBoss extends BossBaseVo implements Serializable {

    private String name;

    private String code;

    private Integer status;

    private Long parentId;

    private Boolean hasPersonal;

    private List<PermissionVoBoss> children;

    private Long levelNumber;

    public PermissionVoBoss() {
    }

    public PermissionVoBoss(Permission permission, Integer status) {
        super.setId(permission.getId());
        super.setCreateDate(permission.getCreateDate());
        super.setUpdateDate(permission.getUpdateDate());
        this.code = permission.getCode();
        this.name = permission.getName();
        this.hasPersonal = permission.getHasPersonal();
        this.status = status;
        this.parentId = permission.getParentId();
        this.levelNumber =  permission.getLevelNumber();
        this.children = null;
    }
}
